<div style="float: right; height: 50px; width: 50px; margin-top: -8px; vertical-align: middle;">
	<pp:dynamic name="edit_folder_no_thumb"><span style="padding-top: 20px; display: block; width: 100px; margin-left: -40px;">Noch kein Bild</span></pp:dynamic>
	<pp:dynamic name="edit_folder_thumb"><img src="{@pp:abs_root}_core/getImage.php?path={@pp:img_path}&height=50&width=50" id="gallery_view_image_image"/></pp:dynamic>
</div>
<h1>Ordner bearbeiten</h1><br />
<div class="h_sep" id="admin_top_hr" style="margin: -5px 0px 5px 0px;">
	<span class="left">&nbsp;</span>
	<span class="right">&nbsp;</span>
	<span class="center">&nbsp;</span>
</div><br />
<div id="edit_album">
	<form action="{@pp:link}" method="post" class="ui_form" id="gallery_edit_folder">
		<br />
		{pp:UIWidgets(widget:Hidden, name:f_id, value:{@pp:id})}
		{pp:UIWidgets(widget:Hidden, name:action, value:edit_folder)}
		<p>
			{pp:UIWidgets("widget":"InputField", "name":"f_name", "value":"{@pp:name}", "label":"Titel", "class":"small", "style":"width: 350px;")}
		</p>
		<p>
			{pp:UIWidgets("widget":"TextArea", "name":"desc", "value":"{@pp:desc}", "label":"Beschreibung", "height":"5", "class":"small", "style":"width: 350px;")}
		</p>
		<p>
			{@pp:status}
		</p>
		<span class="uiwidget_label" style="margin-bottom: -0px; display: inline-block; margin-top: 7px;">Sortierung:</span>
		<div class="button_dropdown" style="padding-left: 105px;">
			<button name="sortierung" class="button small" onclick="tf_showDropdown('gallery_edit_folder_dropdown_sort');return false;" id="gallery_edit_folder_dropdown_sort_btn">
				<span><span class="text">.</span><div class="dropdown_arrow"><img src="{@pp:abs_root}{@pp:tpl_folder}/img/interface/dropdown_arrows.png"/></div></span>
			</button>
			<ul class="button_dropdown_option" id="gallery_edit_folder_dropdown_sort" style="left: 105px;">
				<li id="gallery_edit_folder_dropdown_sort_date"><a href="javascript:void(0);" onclick="setFSort('date', '-1');"><span class="front">&nbsp;</span>Datum</a></li>
				<li id="gallery_edit_folder_dropdown_sort_name"><a href="javascript:void(0);" onclick="setFSort('name', '-1');"><span class="front">&nbsp;</span>Name</a></li>
				<li class="seperator">&nbsp;</li>
				<li id="gallery_edit_folder_dropdown_sort_asc"><a href="javascript:void(0);" onclick="setFSort('-1', 'asc');"><span class="front">&nbsp;</span>Aufsteigend</a></li>
				<li id="gallery_edit_folder_dropdown_sort_desc"><a href="javascript:void(0);" onclick="setFSort('-1', 'desc');"><span class="front">&nbsp;</span>Absteigend</a></li>
			</ul>
			<input type="hidden" name="sort" id="gallery_edit_folder_dropdown_sort_date_input" />
			<input type="hidden" name="sortDA" id="gallery_edit_folder_dropdown_sortda_date_input" />
		</div>
		<br />
		<p>
			{pp:UIWidgets(widget:Button, type:submit, label:&nbsp;, value:&nbsp;&nbsp;&nbsp;Speichern&nbsp;&nbsp;&nbsp;)}
			{pp:UIWidgets(widget:Button, type:reset, value:&nbsp;&nbsp;&nbsp;Zur&uuml;cksetzten&nbsp;&nbsp;&nbsp;)}
			<pp:dynamic name="ajax_button">
				<span style="float: right; display: block;">{pp:UIWidgets(widget:Button, value:&nbsp;&nbsp;&nbsp;Abbrechen&nbsp;&nbsp;&nbsp;, id:ajax_cancel_button, type:button)}</span>
				<script type="text/javascript">
					$(document).ready(function () {
						$('#ajax_cancel_button').click(close_edit_album_form);
					});
				</script>
			</pp:dynamic>
		</p>
	</form>
</div>
<script type="text/javascript">
	$(document).ready(function () {
		$('#gallery_edit_folder').get(0).setAttribute('action', '{@pp:link}#'+$.address.path());
		initFSort();
	});

	function initFSort() {
		setFSort('{@pp:sort}', '{@pp:sortDA}');
	}

	function setFSort(sort, da) {
		if((sort != '-1') && (sort == 'name' || sort == '1')) {
			$('#gallery_edit_folder_dropdown_sort_btn > span > span.text').html('Sortierung nach Name');
			$('#gallery_edit_folder_dropdown_sort_date > a > span').removeClass('selected');
			$('#gallery_edit_folder_dropdown_sort_name > a > span').addClass('selected');
			$('#gallery_edit_folder_dropdown_sort_date_input').val(1);
		} else if((sort != '-1') && (sort == 'date' || sort == '2')) {
			$('#gallery_edit_folder_dropdown_sort_btn > span > span.text').html('Sortierung nach Datum');
			$('#gallery_edit_folder_dropdown_sort_name > a > span').removeClass('selected');
			$('#gallery_edit_folder_dropdown_sort_date > a > span').addClass('selected');
			$('#gallery_edit_folder_dropdown_sort_date_input').val(2);
		}
		if((da != '-1') && (da == 'desc' || da == '2')) {
			$('#gallery_edit_folder_dropdown_sort_asc > a > span').removeClass('selected');
			$('#gallery_edit_folder_dropdown_sort_desc > a > span').addClass('selected');
			$('#gallery_edit_folder_dropdown_sortda_date_input').val(2);
		} else if((da != '-1') && (da == 'asc' || da == '1')) {
			$('#gallery_edit_folder_dropdown_sort_desc > a > span').removeClass('selected');
			$('#gallery_edit_folder_dropdown_sort_asc > a > span').addClass('selected');
			$('#gallery_edit_folder_dropdown_sortda_date_input').val(1);
		}
	}
</script>